home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Experimental BBS Explossion 3
/
Experimental BBS Explossion III.iso
/
c
/
cujoct93.zip
/
1110066A
< prev
next >
Wrap
Text File
|
1993-07-14
|
634b
|
24 lines
// Input stream operator for SPString
// allows the reading of long lines
// and lines terminated by EOF and not '\n'
istream& operator>>(istream& ifs, SPString& s)
{
char c, buf[132];
s= ""; // initialise with an empty string
// read a buffer from the input stream
ifs.get(buf, sizeof buf);
if(ifs){ // if previous operation was ok
s += buf; // append buffer to string
// if its a long line continue appending to string
while(ifs.good() && (c=ifs.get()) != '\n'){
ifs.putback(c);
// append to line
if(ifs.get(buf, sizeof buf)) s += buf;
}
}
return ifs;
}